/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package uimigration.mappingmodel.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import uimigration.WidgetsModel.Property;
import uimigration.mappingmodel.MappingPositionProperties;
import uimigration.mappingmodel.MappingmodelPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Mapping Position Properties</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link uimigration.mappingmodel.impl.MappingPositionPropertiesImpl#getMappedProperties <em>Mapped Properties</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class MappingPositionPropertiesImpl extends EObjectImpl implements
		MappingPositionProperties {
	/**
	 * The cached value of the '{@link #getMappedPropertiesList() <em>Mapped Properties</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMappedPropertiesList()
	 * @generated NOT
	 * @ordered
	 */
	protected EList<Property> mappedProperties;
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected MappingPositionPropertiesImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return MappingmodelPackage.Literals.MAPPING_POSITION_PROPERTIES;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Property> getMappedProperties() {
		if (mappedProperties == null) {
			mappedProperties = new EObjectContainmentEList<Property>(Property.class, this, MappingmodelPackage.MAPPING_POSITION_PROPERTIES__MAPPED_PROPERTIES);
		}
		return mappedProperties;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd,
			int featureID, NotificationChain msgs) {
		switch (featureID) {
			case MappingmodelPackage.MAPPING_POSITION_PROPERTIES__MAPPED_PROPERTIES:
				return ((InternalEList<?>)getMappedProperties()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case MappingmodelPackage.MAPPING_POSITION_PROPERTIES__MAPPED_PROPERTIES:
				return getMappedProperties();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case MappingmodelPackage.MAPPING_POSITION_PROPERTIES__MAPPED_PROPERTIES:
				getMappedProperties().clear();
				getMappedProperties().addAll((Collection<? extends Property>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case MappingmodelPackage.MAPPING_POSITION_PROPERTIES__MAPPED_PROPERTIES:
				getMappedProperties().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case MappingmodelPackage.MAPPING_POSITION_PROPERTIES__MAPPED_PROPERTIES:
				return mappedProperties != null && !mappedProperties.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //MappingPositionPropertiesImpl
